Conversation
kigiri
reviewed
Mar 13, 2026
| const allData = await get<GoogleGroupItem[]>('google/group', { | ||
| q: `select((.kind == "admin#directory#group" and .id == "${id}") or (.kind == "admin#directory#member" and (._key | split("/")[2]) == "${id}"))`, | ||
| }) | ||
|
|
Member
There was a problem hiding this comment.
get group first: google/group/${id}, .name
get members: google/group/${id}/member { email: .email, .id: .id, name: get("google/user", .id) | .fullName }
…on with full names and remove `.env.test`.
…in roles, and streamline team member handling
993422f to
1767154
Compare
kigiri
reviewed
Mar 18, 2026
api/auth.ts
Outdated
| userPicture, | ||
| }) | ||
| if (userInfo.picture) { | ||
| userInfo.picture = await savePicture(userInfo.picture) |
Member
There was a problem hiding this comment.
userInfo.picture &&= await savePicture(userInfo.picture)
kigiri
reviewed
Mar 18, 2026
api/lmdb-store.ts
Outdated
| pending.add(p) | ||
| p.finally(() => pending.delete(p)) | ||
| return 1 | ||
| } |
1767154 to
28ea887
Compare
kigiri
reviewed
Mar 18, 2026
| const userInTeam = async (teamId: string, userId?: string) => { | ||
| if (!userId) return false | ||
| const matches = await get<{ id: string }[]>( | ||
| `google/group/${teamId}`, |
Member
There was a problem hiding this comment.
I think the key is `google/group/${teamId}/members/${id}` so this should be sufficient to check if he is present in the group, using getOne
kigiri
reviewed
Mar 18, 2026
api/routes.ts
Outdated
| const groups = await get<{ id: string; name: string }[]>( | ||
| 'google/group', | ||
| { | ||
| q: 'select((.kind == "admin#directory#group") and (.email | contains("@01edu")) and (.directMembersCount > 1)) | { id: .id, name: .name }', |
Member
There was a problem hiding this comment.
use endswith('@01edu.ai') over contains it's faster
kigiri
reviewed
Mar 18, 2026
| if (!group) throw respond.NotFound({ message: 'Team not found' }) | ||
|
|
||
| const members = await get<{ id: string; email: string }[]>( | ||
| `google/group/${id}`, |
Member
There was a problem hiding this comment.
make sure we don't have the group itself as a result
kigiri
reviewed
Mar 18, 2026
| const team = TeamsCollection.get(teamId) | ||
| if (!team) throw respond.NotFound({ message: 'Team not found' }) | ||
| return team | ||
| fn: async (_ctx, { id }) => { |
Member
There was a problem hiding this comment.
const userNamesCache = new Map<string, string>()
export const getUserName = async (id: string) => {
const cachedName = userNamesCache.get(id)
if (cachedName) return cachedName
const user = await getOne<{ name: { fullName: string } }>(
'google/user',
id,
)
userNamesCache.set(id, user.fullName)
return user.fullName
}
kigiri
reviewed
Mar 18, 2026
api/routes.ts
Outdated
| User, | ||
| UserDef, | ||
| UsersCollection, | ||
| // UsersCollection, |
kigiri
reviewed
Mar 18, 2026
api/user.ts
Outdated
| import { UsersCollection } from '/api/schema.ts' | ||
| import { getOne } from './lmdb-store.ts' | ||
| import { GoogleUserInfo } from './auth.ts' | ||
| // import { UsersCollection } from '/api/schema.ts' |
kigiri
reviewed
Mar 18, 2026
tasks/clickhouse.ts
Outdated
| } catch (error) { | ||
| console.error('Error creating ClickHouse table:', { error }) | ||
| Deno.exit(1) | ||
| // Deno.exit(1) |
kigiri
reviewed
Mar 18, 2026
web/pages/ProjectsPage.tsx
Outdated
| // if ((e.target as HTMLInputElement).checked) { | ||
| // addUserToTeam(user, team) | ||
| // } else removeUserFromTeam(user, team) | ||
| // }} |
kigiri
reviewed
Mar 18, 2026
web/pages/ProjectsPage.tsx
Outdated
|
|
||
| <PageContent> | ||
| {!hasTeams | ||
| {sortedTeams.length === 0 |
8a59743 to
fab1b8b
Compare
…nd un-hardcode checkbox state.
fab1b8b to
7559c15
Compare
kigiri
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor: externalize team management to use lmdb-store for Google Groups.